#pragma once
#include "..\character.h"

class CSGD_DirectInput;
class CSGD_TextureManager;
class CSGD_EventSystem;
class CSGD_Direct3D;
class CFireGun;
class CIceGun;
class CLightningGun;
class CWindGun;
class CAnimationInfo;

class CSGD_DirectInput;
class CSGD_TextureManager;
class CSGD_EventSystem;
class CSGD_Direct3D;
class CFireGun;
class CIceGun;
class CLightningGun;
class CWindGun;

class CPlayer :
	public CCharacter
{
public:
	CPlayer(void);
	~CPlayer(void);
	void AddRef();
	void Update(float fElapsedTime);
	void Input(float fElapsedTime);
	void Render();
	void TakeDamage(float nDamage);
	void Shoot(float fElapsedTime);
	void SwitchGun();
	void Heal(float nAmount);
	bool CheckCollision(IEntity* pOther);
	void PickUp(int nType); // 0 = key, 1 = Shield PowerUp
	void Dash(float fElapsedTime);
	virtual void HandleEvent(CEvent* pEvent);
	RECT GetRect();
	float GetEnergy() {return m_nEnergy;}
	POINT GetMouseClick() {return m_poMouseClick;}
	void Load(int nSave);
	void Save(int nSave);
	void Init();
private:
	enum Guns {GUN_FIRE, GUN_ICE, GUN_LIGHTNING, GUN_WIND };
	Guns m_eCurrGun; // Which gun is equipped
	CFireGun* m_pgFireGun; // pg = Pointer Gun
	CIceGun* m_pgIceGun;
	CWindGun* m_pgWindGun;
	CLightningGun* m_pgLiGun;

	float m_fElapsedTime;
	bool m_bOnTar;
	bool m_bOnIce;
	float m_fTarDuration;

	CSGD_TextureManager* m_pTM;
	CSGD_DirectInput* m_pDI;
	CSGD_EventSystem* m_pES;
	CSGD_Direct3D* m_pD3D;
	
	tVector2D m_vToMouse;
	bool m_bIsDashing; // Am I dashing
	float m_fDashCooldown; // 2.0f sec
	int m_nNumKeys; // 0-3
	float m_nEnergy;
	float m_nMaxEnergy;
	float m_nEnergyRegenRate;
	POINT m_poMouseClick; // For any gun that needs to know where the player clicked
	int m_nEnemies; // How many enemies have I killed?
	int m_nCurrLevel; // Which Dungeon am I on?
	int m_nCurrFloor; // Which Floor am I on in my current Dungeon?

	// Power Ups
	int m_nPowerUp; // 0-6 What kind do I have
	bool m_bShield; // Is my Shield Powerup on?
	float m_fShieldDuration;
	float m_fShieldCoolDown;

	CAnimationInfo* m_cAnimationInfo;

};

